import React from 'react';

const SuperSelect = ({ options, value, onChange, placeholder, label, state, className }) => {
  return (
    <div className={`mb-2 ${className}`}>
      {label && <p className='form-label text-sm text-black  pb-1 bg-none'>{label}：</p>}
      <select value={value || ''} onChange={(e) => onChange(e.target.value)} className="select focus:outline-none border border-gray-300 rounded-xs bg-[#ffffff00] w-full" >
        {placeholder && <option value="" disabled>{placeholder}</option>}
        {options.map((option) => (
          <option disabled={!state} key={option.value} value={option.value}> {option.label}{option.description && <>（{option.description}）</>} </option>
        ))}
      </select>
    </div>
  );
};

export default SuperSelect;
